<?php

namespace App\Models\V1;

use Illuminate\Database\Eloquent\Factories\HasFactory;

class Evaluating extends BaseModel
{
    use HasFactory;
    protected $connection;
    protected $table="evaluating";
    protected $fillable=['id','ulid','game_id','evaluating','type','class','title','logo','content','ratio','gameimg','apkadd','pcadd','remark','state','channel_state','reasons','platform','system','user','user_name','settlement_ratio','settlement_interval'];

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
        $this->connection = config('database.connections.biqi_game.database');
    }

    protected $casts = [
        'system' => 'json',
    ];


    public function getSystemAttribute($value)
    {
        return json_decode($value, true);
    }

    public function setGameimgAttribute($value)
    {
        $this->attributes['gameimg'] = json_encode(explode(',', $value));

    }






}
